//Monday, October 26 2009
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class PlayGame
{
	public:
		int saveCreatures(vector <int> you, vector <int> computer)
		{
			sort(you.begin(), you.end());
			reverse(you.begin(), you.end());
			sort(computer.begin(), computer.end());
			reverse(computer.begin(), computer.end());
			int ret = 0;
			for(int i=0, j=0; i<computer.size(); i++)
			{
				if(you[j] > computer[i])
				{
					ret += you[j];
					j++;
				}
			}
			return ret;
		}
};
